<!--
 *                        .::::.
 *                      .::::::::.
 *                     :::::::::::
 *                  ..:::::::::::'
 *               '::::::::::::'
 *                 .::::::::::
 *            '::::::::::::::..
 *                 ..::::::::::::.
 *               ``::::::::::::::::
 *                ::::``:::::::::'        .:::.
 *               ::::'   ':::::'       .::::::::.
 *             .::::'      ::::     .:::::::'::::.
 *            .:::'       :::::  .:::::::::' ':::::.
 *           .::'        :::::.:::::::::'      ':::::.
 *          .::'         ::::::::::::::'         ``::::.
 *      ...:::           ::::::::::::'              ``::.
 *     ````':.          ':::::::::'                  ::::..
 *                        '.:::::'                    ':'````..
 *
 * @Descripttion:
 * @version:
 * @Date: 2022-03-23 12:01:36
 * @LastEditors: huzhushan@126.com
 * @LastEditTime: 2022-03-25 10:02:51
 * @Author: huzhushan@126.com
 * @HomePage: https://huzhushan.gitee.io/vue3-element-admin
 * @Github: https://github.com/huzhushan/vue3-element-admin
 * @Donate: https://huzhushan.gitee.io/vue3-element-admin/donate/
 -->
<template>
  <div class="app-container">
    <el-form
      ref="form"
      label-position="top"
      :model="model"
      :rules="rules"
      style="width: 400px"
    >
      <el-tag class="password-tip">
        <div class="inner">
          <i class="el-icon-warning"></i>
          <div>密码要求至少8位数，大写、小写字母、数字、特殊符号的组合</div>
        </div>
      </el-tag>
      <el-form-item label="原密码" prop="password">
        <el-input
          v-model="model.password"
          show-password
          placeholder="原密码"
        ></el-input>
      </el-form-item>
      <el-form-item label="新密码" prop="newpassword">
        <el-input
          v-model="model.newpassword"
          show-password
          placeholder="新密码"
        ></el-input>
      </el-form-item>
      <el-form-item label="再次输入新密码" prop="surepassword">
        <el-input
          v-model="model.surepassword"
          show-password
          placeholder="新密码"
        ></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="handleSubmit">提交</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  name: 'Password',

  data() {
    return {
      model: {
        password: '',
        newpassword: '',
        surepassword: '',
      },
      rules: {
        password: [
          {
            required: true,
            message: '请输入原密码',
            trigger: 'blur',
          },
        ],
        newpassword: [
          {
            required: true,
            message: '请输入新密码',
            trigger: 'blur',
          },
        ],
        surepassword: [
          {
            required: true,
            message: '请再次输入新密码',
            trigger: 'blur',
          },
        ],
      },
    }
  },

  methods: {
    handleSubmit() {
      this.$refs.form.validate()
    },
  },
}
</script>
<style lang="scss" scoped>
.password-tip {
  display: block;
  height: auto;
  padding-top: 6px;
  padding-bottom: 6px;
  margin-top: 8px;
  .inner {
    display: flex;
    align-items: center;

    .el-icon-warning {
      margin-right: 10px;
    }
    > div {
      flex: 1;
      white-space: normal;
      line-height: 1.8;
    }
  }
}
</style>
